import React,{PropTypes, Component } from 'react';
import {Breadcrumb,Icon} from 'antd';

import {redirect} from "../../lib/utils";


export default class Crumb extends React.Component {


    constructor(props){
        super(props)

    }


    render(){

        return (
            <Breadcrumb style={{margin: '15px 0'}}>
                {
                    this.props.crumb.map((v,k) => {
                        return (
                            <Breadcrumb.Item  href="javascript:;" key={k} onClick={ _ => {
                                if(v.href){
                                    redirect(v.href);
                                }
                            }}>
                                <span>{v.title}</span>
                            </Breadcrumb.Item>
                        )
                    })
                }
            </Breadcrumb>
        )
    }

}